#include<iostream>
#include<cmath>
using namespace std;

void CCpaymentCalculator()
{
    double APR; 
    double AER;
    double balance;
    double n;
    double payment;
    
    cout <<"Welcome to the Credit Card outstanding balance payment calculator."<<endl;
    cout <<"Enter your current outstanding balance: ";
    cin >> balance;
    cout << endl;
    cout <<"Enter the APR(Annual Precentage Rate): ";
    cin >> APR;
    cout << endl;
    cout <<"Lastly, enter how many months do you intend to pay off the balance: ";
    cin >> n;
    cout << endl;

    AER = pow((1+APR/12),12) - 1 ;
    payment = balance / ((pow(1+AER/12,-n)-1)/(AER/12));

    cout << "Your will have to pay $" <<  -1* payment << "each month!" << endl;

}